package lab02.test28;

import java.util.InputMismatchException;
import java.util.Scanner;

import static java.lang.System.out;
import static java.lang.System.setOut;

public class Test28 {

    public static void main(String[] args) {
//        Scanner sc1 = new Scanner(System.in);
        double π = 3.14159;

        outer:
        while (true) {
            try {

                System.out.println("输入一个 double 型的数字：");

                Scanner sc = new Scanner(System.in);
                double radius = sc.nextDouble();

                System.out.println("面积" + π * radius * radius);

                break outer;
            } catch (InputMismatchException a) {
                out.println("输入有误，不是double型数据");
            }
        }
    }
}
